Skip to content

gh-158597: Omit declaration locations for shared lazy submodules - #162389

Open
pablogsal wants to merge 1 commit into
python:mainfrom
pablogsal:gh-158597-omit-shared-declaration
Open

pablogsal wants to merge 1 commit into
python:mainfrom
pablogsal:gh-158597-omit-shared-declaration

Conversation

@pablogsal

@pablogsal pablogsal commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

When two modules lazily import the same package child, a later failure can point to the wrong module's import statement.

Omit the extra declaration frame and location note for submodule imports through shared package attributes. Keep the actual failure traceback and declaration locations for direct lazy imports. This also omits the extra location when only one declaration exists.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #36066740 | 📁 Comparing deb8259 against main (1822ff5)

  🔍 Preview build  

2 files changed
± whatsnew/3.15.html
± whatsnew/changelog.html

@pablogsal

Copy link
Copy Markdown
Member Author

CC @DinoV

@pablogsal
pablogsal marked this pull request as ready for review November 21, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant